<template>
  <div class="content">
    <u-picker
      @cancel="closePop"
      @close="closePop"
      closeOnClickOverlay
      title="选择接单群"
      :show="show"
      :columns="columns"
      keyName="name"
      @confirm="changeCity"
    ></u-picker>
  </div>
</template>

<script>
import api from "@/api"
export default {
  options: {
    styleIsolation: "shared",
  },
  props: {
    show: {
      type: Boolean,
      required: true,
    },
    isRefresh1: {
      type: Number,
      default: 0,
    },
  },
  watch: {
    isRefresh1: {
      handler(n, o) {
        if (n) {
          console.log("刷新了")
          this.getList()
        }
      },
    },
  },
  data() {
    return {
      columns: [],
    }
  },
  mounted() {
    console.log("aaaa")
  },
  methods: {
    // 获取列表
    getList() {
      api.user.sell_group().then((res) => {
        if (res.code == 200) {
          this.columns = [res.data]
        }
      })
    },

    // 关闭弹窗
    closePop() {
      this.$emit("closeCity")
    },

    // 确定
    changeCity(e) {
      console.log(e)
      this.$emit("confirm", e.value[0])
    },
  },
}
</script>

<style lang="scss" scoped>
.content {
  /deep/ .u-popup__content {
    border-top-right-radius: 30rpx;
    border-top-left-radius: 30rpx;
  }
}
</style>
